﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="RolesManagerment.aspx.cs" Inherits="MLM.AdminCP.Pages.RolesManagerment" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <telerik:RadGrid ID="RadRolesGrid" runat="server" AllowFilteringByColumn="True" DataSourceID="GroupRolesEds"
        AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="True"
         AllowAutomaticInserts="True" 
        AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"
        ShowFooter="True" ShowStatusBar="True" 
        meta:resourcekey="RadRolesGridResource1">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="RoleID" DataSourceID="GroupRolesEds"
            ShowHeader="true" ShowHeadersWhenNoRecords="true" AllowAutomaticInserts="true"
            CommandItemDisplay="TopAndBottom">
            <%--<MasterTableView ShowFooter="false" DataKeyNames="ProductID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">--%>
            <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true">
                <%--ExportToPdfText="Export to Pdf">--%></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="RoleID" DataType="System.Int32" HeaderText="RoleID"
                    ReadOnly="True" SortExpression="RoleID" UniqueName="RoleID" 
                    meta:resourcekey="GridBoundColumnResource1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                    UniqueName="Name" meta:resourcekey="GridBoundColumnResource2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ParentID" HeaderText="ParentID" SortExpression="ParentID"
                    UniqueName="ParentID" DataType="System.Int32" 
                    meta:resourcekey="GridBoundColumnResource3">
                </telerik:GridBoundColumn>
                <%--Them edit vao bang --FooterText="EditCommand footer"--%>
                <%--Them edit vao bang --FooterText="EditCommand footer"--%>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <table id="Table2" style="border-collapse: collapse; padding-left: 20">
                        <tr class="EditFormHeader" style="height: 30">
                            <td style="font-size: small">
                                <b>
                                    <asp:Label runat="server" ID="lbProductDetails" Text="Product Details" 
                                    meta:resourcekey="lbProductDetailsResource1"></asp:Label></b>
                            </td>
                        </tr>
                        <tr style="height: 30">
                            <td>
                                <asp:Label runat="server" ID="lbRoleID" Text="RoleID:" 
                                    meta:resourcekey="lbRoleIDResource1"></asp:Label>
                            </td>
                            <td style="width: 30">
                                <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("RoleID") %>' 
                                    TabIndex="1" meta:resourcekey="TextBox8Resource1"></asp:TextBox>
                            </td>
                            <td style="padding-left: 20; padding-right: 30">
                                <asp:Label runat="server" ID="lbName" Text="Name:" 
                                    meta:resourcekey="lbNameResource1"></asp:Label>
                            </td>
                            <td style="width: 50">
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Name") %>' 
                                    TabIndex="1" meta:resourcekey="TextBox2Resource1"></asp:TextBox>
                            </td>
                        </tr>
                        <tr style="height: 30">
                            <td>
                                <asp:Label runat="server" ID="lbParentID" Text="ParentID:" 
                                    meta:resourcekey="lbParentIDResource1"></asp:Label>
                            </td>
                            <td style="width: 30">
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ParentID") %>' 
                                    TabIndex="1" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-bottom: 10; padding-top: 10">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" 
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' 
                                    meta:resourcekey="btnUpdateResource1">
                                </asp:Button>
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel" meta:resourcekey="btnCancelResource1"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <%-- <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>--%>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="GroupRolesEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="Roles" 
        EntityTypeFilter="" Select="">
    </asp:EntityDataSource>
</asp:Content>
<%--<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" runat="server">
</asp:Content>--%>
